<html>
<head><meta charset="utf-8"><title>Debugging Comments · t-compiler/rust-analyzer · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/index.html">t-compiler/rust-analyzer</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Debugging.20Comments.html">Debugging Comments</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="178099326"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Debugging%20Comments/near/178099326" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jason Williams <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Debugging.20Comments.html#178099326">(Oct 14 2019 at 12:44)</a>:</h4>
<p><a href="https://github.com/rust-analyzer/rust-analyzer/issues/1997" target="_blank" title="https://github.com/rust-analyzer/rust-analyzer/issues/1997">https://github.com/rust-analyzer/rust-analyzer/issues/1997</a> whats the best way of debugging the output of comments whilst working on the PR? i could run dbg!() but not sure where that would output too. Are people just rebuilding and re-installing the extension in vscode?</p>



<a name="178099386"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Debugging%20Comments/near/178099386" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Laurențiu <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Debugging.20Comments.html#178099386">(Oct 14 2019 at 12:45)</a>:</h4>
<p><a href="https://github.com/rust-analyzer/rust-analyzer/tree/master/docs/dev#logging" target="_blank" title="https://github.com/rust-analyzer/rust-analyzer/tree/master/docs/dev#logging">https://github.com/rust-analyzer/rust-analyzer/tree/master/docs/dev#logging</a></p>



<a name="178099398"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Debugging%20Comments/near/178099398" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Laurențiu <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Debugging.20Comments.html#178099398">(Oct 14 2019 at 12:45)</a>:</h4>
<p><code>RA_LOG_DIR=1</code> worked for me</p>



<a name="178099546"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Debugging%20Comments/near/178099546" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Debugging.20Comments.html#178099546">(Oct 14 2019 at 12:47)</a>:</h4>
<p>The best way would be to write a test</p>



<a name="178099561"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Debugging%20Comments/near/178099561" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Debugging.20Comments.html#178099561">(Oct 14 2019 at 12:47)</a>:</h4>
<p>I think the best way to exercise this functionality is via hover test,like this one: <a href="https://github.com/rust-analyzer/rust-analyzer/blob/1f4fbc0035a6a9ee1b599a3aa9f236989633a9f7/crates/ra_ide_api/src/hover.rs#L474-L512" target="_blank" title="https://github.com/rust-analyzer/rust-analyzer/blob/1f4fbc0035a6a9ee1b599a3aa9f236989633a9f7/crates/ra_ide_api/src/hover.rs#L474-L512">https://github.com/rust-analyzer/rust-analyzer/blob/1f4fbc0035a6a9ee1b599a3aa9f236989633a9f7/crates/ra_ide_api/src/hover.rs#L474-L512</a></p>



<a name="178101212"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Debugging%20Comments/near/178101212" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jason Williams <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Debugging.20Comments.html#178101212">(Oct 14 2019 at 13:09)</a>:</h4>
<p>Thanks</p>



<a name="178101334"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Debugging%20Comments/near/178101334" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jason Williams <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Debugging.20Comments.html#178101334">(Oct 14 2019 at 13:10)</a>:</h4>
<p>is not stripping tailing whitespace enough? Do we not need to replace trailing whitespace with a \n so vscode actually places the next line on a new line?</p>



<a name="178101563"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Debugging%20Comments/near/178101563" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Debugging.20Comments.html#178101563">(Oct 14 2019 at 13:13)</a>:</h4>
<p>Hm, yeah, I think what we want for</p>
<div class="codehilite"><pre><span></span>/// hello
/// world
</pre></div>


<p>is </p>
<div class="codehilite"><pre><span></span>hello   \nworld\n
</pre></div>



<a name="178104037"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Debugging%20Comments/near/178104037" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jeremy Kolb <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Debugging.20Comments.html#178104037">(Oct 14 2019 at 13:45)</a>:</h4>
<p>I think there are some basic doc comment tests in <code>ast.rs</code> that do not go through hover etc.</p>



<a name="178105428"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Debugging%20Comments/near/178105428" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jeremy Kolb <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Debugging.20Comments.html#178105428">(Oct 14 2019 at 14:00)</a>:</h4>
<p><span class="user-mention" data-user-id="244614">@Jason Williams</span> These are the ones I am referring to: <a href="https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ra_syntax/src/ast.rs#L86-L195" target="_blank" title="https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ra_syntax/src/ast.rs#L86-L195">https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ra_syntax/src/ast.rs#L86-L195</a></p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>